1. Field
The exemplary embodiments relate to a method and apparatus for encoding and decoding image data, and more particularly to a method and apparatus for encoding and decoding image data using a run of the image data.
2. Description of the Related Art
In general, in order to perform a lossless compression of image data, an entropy method is used. A representative example of the entropy method is a run-length coding method.
The run-length coding method is a coding method that compresses image data by processing the same pixel values as a run if the same pixel values are successively generated. In the case of using such a run-length coding in an image having a high resolution, more efficient compression of image data can be performed if the run is generated.
On the other hand, pixels that constitute image data may be repeated with a predetermined pattern. Particularly, in the case of image data for a printer, a facsimile, and the like, such a predetermined pattern is frequently formed. FIG. 1 is a diagram illustrating an example of image data composed of patterns. Referring to FIG. 1, the reference numeral “100” is composed of reference numerals “101” to “107”. It can be seen that pixels constituting the reference numerals “101” to “107” have the same pixel structure.
Also, image data may have different patterns or run types in accordance with its characteristics. For example, in a background image in which pixel values are scarcely changed or a gradation image in which pixel values are successively and constantly changed, different types of patterns or runs may be generated. The run-length coding method in the related art performs the run-length coding without considering diverse characteristics of the image data.